home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
TVHOURS.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
1KB
|
29 lines
' TVHOURS.BAS
' This program uses DATA, READ, and RESTORE statements to track
' the number of TV hours viewed over a three-week time period.
CLS
PRINT "How many hours of TV did you watch during the last 3 weeks?"
PRINT
FOR i% = 1 TO 3 ' for each of the last 3 weeks
FOR j% = 1 TO 7 ' and for each day in the week
READ day$ ' read day name from DATA list
PRINT day$; ", Week"; i%; ' prompt with day and week
INPUT "--> ", hours! ' get TV hours for that day
totalHours! = totalHours! + hours! ' total all the hours
NEXT j%
PRINT ' print a blank line after each week
RESTORE ' move data pointer to Monday for next iteration
NEXT i%
PRINT "You watched"; ' display total number of hours
COLOR 20 ' in blinking red for fun
PRINT totalHours!; "hours";
COLOR 7 ' return foreground color to white
PRINT " of television during the last three weeks!"
DATA Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday